package com.hermit.alaskagulfcustom.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author hermit
 * @data 2021/6/11
 */
// name: 对应yml文件中spring.application.name
// fallbackFactory: 降级 当服务器宕机时返回给页面的异常处理
//@FeignClient(value = "provider-server", fallbackFactory = FeignServiceFallBack.class)
@FeignClient(url = "http://127.0.0.1:8080", name = "provider-server", fallbackFactory = FeignServiceFallBack.class)
public interface CustomFeign {

    // 路径，方法名称必须与生产者一致，否则无法调用
    @GetMapping("/provider-index")
    String index();

    @GetMapping("/test-openfeign")
    String testOpenFeign();
}
